package com.kotlin.hxh.ui.fragment.fourth.child

import android.os.Bundle
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import com.kotlin.hxh.R
import com.kotlin.hxh.base.BaseMainFragment
import com.kotlin.hxh.ui.fragment.fourth.ZhihuFourthFragment
import kotlinx.android.synthetic.main.zhihu_fragment_fourth_me.*


/**
 * @author huxh
 * @date 2018/12/20.
 */
class MeFragment : BaseMainFragment() {
    companion object {
        @JvmStatic
        fun newInstance(): MeFragment {
            val fragment = MeFragment()
            fragment.arguments = Bundle()
            return fragment
        }
    }

    override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?) = inflater.inflate(R.layout.zhihu_fragment_fourth_me, container, false)

    override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
        super.onViewCreated(view, savedInstanceState)
        initView()
    }

    private fun initView() {

        tv_btn_settings.setOnClickListener { start(SettingsFragment.newInstance()) }
    }

    override fun onBackPressedSupport(): Boolean {
        (parentFragment as ZhihuFourthFragment).onBackToFirstFragment()
        return true
    }
}